package com.hippomeetsskunk.savanna.types.person;

import java.util.HashMap;
import java.util.Map;

import com.hippomeetsskunk.savanna.model.ModelProvider;

public class Attributes {

	public enum Attribute{
		HEALTH
	};
	
	private Map<Attribute, Double> state = new HashMap<Attribute, Double>();
	private Map<Attribute, Double> level = new HashMap<Attribute, Double>();
	
	public void set(Attribute attribute, double level, double state){
		this.state.put(attribute, state);
		this.level.put(attribute, level);
	}
	
	public void add(Attribute attribute, double value){
		double newValue = ModelProvider.getInstance().getAttributeModel().add(state.get(attribute), level.get(attribute), value);
		state.put(attribute, newValue);
	}
	
	public double get(Attribute attribute){
		return (state.containsKey(attribute)) ? state.get(attribute) : 0.0;
	}
}
